import request from '@/utils/request'

// 查询木业客户信息列表
export function listCustomer(query) {
  return request({
    url: '/customer/customer/list',
    method: 'get',
    params: query
  })
}

// 查询木业客户信息详细
export function getCustomer(customerCode) {
  return request({
    url: '/customer/customer/' + customerCode,
    method: 'get'
  })
}

// 新增木业客户信息
export function addCustomer(data) {
  return request({
    url: '/customer/customer',
    method: 'post',
    data: data
  })
}

// 修改木业基础数据状态
export function editCustomerStatus(customerCode,status) {
  const data = {
    customerCode,
    status
  }
  return request({
    url: '/customer/customer/editState',
    method: 'put',
    data: data
  })
}

// 修改木业客户信息
export function updateCustomer(data) {
  return request({
    url: '/customer/customer',
    method: 'put',
    data: data
  })
}

// 分配销售员
export function editCustomers(data) {
  return request({
    url: '/customer/customer/editAllotEmployee',
    method: 'put',
    data: data
  })
}
// 删除木业客户信息
export function delCustomer(customerCode) {
  return request({
    url: '/customer/customer/' + customerCode,
    method: 'delete'
  })
}

// 导出木业客户信息
export function exportCustomer(query) {
  return request({
    url: '/customer/customer/export',
    method: 'get',
    params: query
  })
}
